how to evaluate the left and right hand limits of a piecewise function